package com.bdsy.fastDFS;

import org.junit.Test;

 /**
 * ClassName:FastDFS
 * Function: TODO ADD FUNCTION.
 * Reason:	 TODO ADD REASON.
 * Date:     2017年6月1日 下午3:21:04
 * @author   Administrator
 * @version  
 * @since    JDK 1.7
 * @see 	 
 */
public class FastDFS {

	/**
	 * 		group1
			M00/00/00/wKgB9lkvwSCAOTIkAAEV7IgL0pU819.jpg
	 *
	 *
	 *
	 *
	 */
	@Test
	public void testFastDFS() {
		
/*		 
 * //测试文件上传的方法，参数不是字节数组。
 * 		String filePath = "C:\\Users\\Administrator\\Desktop\\2008030811454996ecd.jpg";
		    Map<String,String> metaMap=new HashMap<String,String>();
		    metaMap.put("pic_id","10000");
		    metaMap.put("hight", "200");
		    metaMap.put("size", "378");
		String[] uploadFile = FastDFSutils.uploadFile(filePath,"jpg", metaMap);
		System.out.println(uploadFile[0]);
		System.out.println(uploadFile[1]);
		//测试获取文件URL的方法
		String fileUrl = FastDFSutils.getFileUrl("group1", "M00/00/00/wKgB9lkvwSCAOTIkAAEV7IgL0pU819.jpg");
		System.out.println(fileUrl);
		//测试下载文件的方法，返回boolean类型
		boolean downloadFile = FastDFSutils.downloadFile("group1", "M00/00/00/wKgB9lkvwSCAOTIkAAEV7IgL0pU819.jpg", "D:/aaa/bb/cc/dd/", "jpg");
		System.out.println(downloadFile);
		//测试下载返回数组的方法
		byte[] downloadFile = FastDFSUtils.downloadFile("group1", "M00/00/00/wKgB9lkvwSCAOTIkAAEV7IgL0pU819.jpg");
		System.out.println(downloadFile.length);	
		//测试修改页面功能
		boolean deleteFile = FastDFSUtils.deleteFile("group1", "M00/00/00/wKgB9lkvwSCAOTIkAAEV7IgL0pU819.jpg");
		System.out.println(deleteFile);
		
		String fileUrl = FastDFSUtils.getFileUrl("group1", "M00/00/00/wKgB9lkvwSCAOTIkAAEV7IgL0pU819.jpg");
		System.out.println(fileUrl);*/
	}
	
}

